import { getAction, deleteAction, putAction, postAction } from '@/api/manage'

// 数据字典
const addDict = (params) => postAction('/app/system/dict/add', params)
const editDict = (params) => putAction('/app/system/dict/edit', params)
// const getDictList = (params)=>getAction("/sys/dict/list",params);
// const treeList = (params) => getAction('/sys/dict/treeList', params)
// const delDict = (params)=>deleteAction("/sys/dict/delete",params);
// const getDictItemList = (params)=>getAction("/sys/dictItem/list",params);
const addDictItem = (params) => postAction('/app/system/dictItem/add', params)
const editDictItem = (params) => putAction('/app/system/dictItem/edit', params)
const delDictItem = (params) => deleteAction('/app/system/dictItem/delete', params)
// const delDictItemList = (params)=>deleteAction("/sys/dictItem/deleteBatch",params);
// 字典标签专用（通过code获取字典数组）
const ajaxGetDictItems = (code, params) => getAction(`/app/system/dict/getDictItems/${code}`, params)

// 重复校验
const duplicateCheck = (params) => getAction('/app/duplicate/check', params)
export {
  addDict,
  editDict,
  addDictItem,
  editDictItem,
  delDictItem,
  duplicateCheck,
  ajaxGetDictItems
}
